package com.back.baseModule.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

/**
 * @author zjq
 * @create 2022-11-17 16:18
 */
@Data
@Entity
@Table(name = "sys_user")
public class SysUser implements Serializable {


    @Id
    @Column(name = "id", nullable = false)
    @JsonSerialize(using= ToStringSerializer.class)
    private String id;

    /**
     * 密码
     */
    @Column(name = "password")
    private String password;

    /**
     * 头像
     */
    @Column(name = "icon")
    private String icon;

    /**
     * 邮箱
     */
    @Column(name = "email")
    private String email;

    /**
     * 电话/用户名
     */
    @Column(name = "tel")
    private String tel;

    /**
     * 姓名
     */
    @Column(name = "name")
    private String name;

    /**
     * 性别；0-保密；1-女；2-男
     */
    @Column(name = "sex")
    private Boolean sex;

    /**
     * 备注信息
     */
    @Column(name = "note")
    private String note;

    /**
     * 单位
     */
    @Column(name = "unit")
    private String unit;

    /**
     * 身份证
     */
    @Column(name = "id_card_num")
    private String idCardNum;

    /**
     * 创建人
     */
    @Column(name = "create_user_id")
    private String createUserId;

    /**
     * 创建时间
     */
    @Column(name = "create_time")
    private Date createTime;

    /**
     * 最后登录时间
     */
    @Column(name = "login_time")
    private Date loginTime;

    /**
     * 帐号启用状态：0->禁用；1->启用
     */
    @Column(name = "status")
    private Boolean status;

    /**
     * 删除状态：0->正常；1->删除
     */
    @Column(name = "del_type")
    private Boolean delType;

    /**
     * 管理员身份：0-超级管理员；1->系统管理员
     */
    @Column(name = "sys_user_type")
    private Integer sysUserType;

    /**
     * 小程序用户标识
     */
    @Column(name = "open_id")
    private String openId;

    /**
     * 单位性质
     */
    @Column(name = "unit_nature")
    private String unitNature;

    private String username;

}
